package org.example;
/*
这是一个计算器类，通过批量处理要发现Bug
 */
public class Calculator {
    private static int result;
    public void add(int n){
        result=result+n;
    }
    public void square(int n){
        result=n*n;
    }
    public void substract(int n){
        result=result-n;
    }
    public void multiple(int n){

    }
    public void divide(int n){
        result=result/n;
    }
    public void squareRoot(int n){
        for(;;);
    }
    public void clear(){
        result=0;
    }
    public int getResult(){
        return result;
    }
}
